package main

import "fmt"

/**
 * @author: guangcheng
 * @date:   2020/11/21 20:46
 * @version  V1.0
 * @description:
 *
 */
func main() {
	//1
	var ns NullStruct
	ns.PrintRect()

	fmt.Println("---------------------------")
	//2
	ns.PrintRect2(2, 20)

	fmt.Println("---------------------------")
	//3
	area := ns.PrintRect3(6, 30)
	fmt.Println("area=", area)

}

type NullStruct struct {
	//哈哈哈, 啥也没有
}

func (ns NullStruct) PrintRect() {

	for i := 0; i < 6; i++ {
		for j := 0; j < 8; j++ {
			fmt.Print("*")
		}
		fmt.Println()
	}
}

func (ns NullStruct) PrintRect2(m int, n int) {
	for i := 0; i < m; i++ {
		for j := 0; j < n; j++ {
			fmt.Print("*")
		}
		fmt.Println()
	}
}

func (ns NullStruct) PrintRect3(m int, n int) int {
	for i := 0; i < m; i++ {
		for j := 0; j < n; j++ {
			fmt.Print("*")
		}
		fmt.Println()
	}

	return m * n
}
